import Vue from "vue";
import VueI18n from "vue-i18n";
import enLocale from "./en.js";
import zhLocale from "./zh.js";
import twLocale from "./zh-tw.js";
import jpLocale from "./jp.js";
import koLocale from "./ko.js";
Vue.use(VueI18n);
let lang = uni.getLocale()
if(lang == 'zh-Hans'){
	lang = 'zh-cn'
}else if(lang == 'en'){
	lang = 'zh-en'
}else{
	lang = 'zh-tw'
}
const value = uni.getStorageSync("language")
if (value) {
  lang = value
}
// let locale = zhCN;
// if (lang === "zh-CN") {
//   locale = zhCN;
// } else {
//   locale = enUS;
// }

const i18n = new VueI18n({
  locale: lang,
  messages: {
    "zh-cn": zhLocale,
    "zh-en": enLocale,
	"zh-tw": twLocale,
	"zh-hw": koLocale,
	"zh-rw": jpLocale,
  },
});
 
export { i18n, lang };

